local sz_huanyin = fk.CreateSkill {
    name = "sz_huanyin",
}

Fk:loadTranslationTable {
    ["sz_huanyin"] = "幻瘾",
    [":sz_huanyin"] = "出牌阶段，你可以失去X点体力，增加等量的体力上限，摸等量的牌(X为此技能本阶段的发动次数)。",

}

sz_huanyin:addEffect("active", {
    anim_type = "offensive",
    prompt = function(self)
        local x = Self:usedSkillTimes(sz_huanyin.name, Player.HistoryPhase) + 1
        return "幻瘾：是否失去" .. x .. "点体力，摸" .. x .. "张牌，增加" .. x .. "点体力上限？"
    end,
    card_num = 0,
    mtarget_num = 0,
    can_use = function(self, player)
        return not player.dead
    end,
    card_filter = Util.FalseFunc,
    on_use = function(self, room, effect)
        local player = effect.from
        local x = player:usedSkillTimes(sz_huanyin.name, Player.HistoryPhase)
        room:loseHp(player, x, sz_huanyin.name)
        player:drawCards(x, sz_huanyin.name)
        room:changeMaxHp(player, x)
    end,
})

return sz_huanyin
